home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar Extras 3
/
Ex3side1.d64
/
mini source
< prev
next >
Wrap
Text File
|
2022-08-28
|
5KB
|
531 lines
open =$ffc0
readst =$ffb7
setlfs =$ffba
setnam =$ffbd
setmsg =$ff90
load =$ffd5
getin =$ffe4
input'buffer =512
clrchn =$ffcc
close =$ffc3 ;a
chrin =$ffcf
chkout =$ffc9 ;x
chkin =$ffc6 ;x
plot =$fff0
chrout =$ffd2
color'pointer =243
screen'line'pointer =209
print'number =$bdcd ;x,a
clear'line =59903
background =53281
border =53280
strout = $ab1e; .A low .Y high
unlisten =$ffae
clall =$ffe7
color1 =53282
color2 =53283
color3 =53284
white =5
crsr'down =17
rvs'on =18
home =19
del =20
red =28
crsr'right =29
green =30
blue =31
black =144
lowercase =14
uppercase =142
crsr'up =145
rvs'off =146
clr =147
insert =148
brown =149
light'red =150
dark'grey =151
medium'grey =152
light'green =153
light'blue =154
light'grey =155
purple =156
crsr'left =157
yellow =158
cyan =159
top'left =176
top'right =174
bottom'left =173
bottom'right =189
box'parameters =820
x1 =820
x2 =821
y1 =822
y2 =823
screen'code =824
box'color =825
flag =826
temp =827
.org $c000
;obj "@2:toolkit c000"
.mem
jmp menu'entry
jmp box'entry
jmp screen'stash
jmp screen'restore
jmp linx
jmp print'at
jmp center
jmp ucase
jmp lcase
jmp fcase
;sys,addr y,x1,x2,number items,text,highlight,esc
;***sys addr,x,to x,y,to y,s-code,color
box'entry lda #0
sta temp
- jsr get'number
ldy temp
sta box'parameters,y
inc temp
cpy #5
bne -
fill'box jsr linx
lda 214
pha
lda 211
pha
box'start ldx box'parameters+2
ldy #0
clc
jsr $fff0
jsr old'rom'patch
dec box'parameters
;inc box'parameters+3
- ldy box'parameters+1
- lda box'parameters+4
cmp #255
beq +
sta (209),y
+ lda box'parameters+5
sta (243),y
dey
cpy box'parameters
bne -
lda 214
cmp box'parameters+3
beq +
inc 214
jsr 58732
jsr old'rom'patch
jmp --
+ lda #home
jsr $ffd2
pla
sta 211
pla
sta 214
jmp 58732
linx ldy #24
- lda 217,y
ora #128
sta 217,y
dey
bpl -
rts
screen'stash sec
jsr plot
stx menuy
sty menux1
jsr get'number
sta 252
cmp >1024
bcs +
rts
+ clc
adc #4
sta 254
lda #0
sta 253
sta 251
lda #home
jsr chrout
jsr old'rom'patch
sei
lda #0
sta 1
ldx #3
ldy #0
- lda (209),y
sta (251),y
dec 1
lda (243),y
inc 1
sta (253),y
iny
bne -
inc 210
inc 252
inc 244
inc 254
dex
bpl -
dec 254
ldy #233
dec 1
lda 53280
inc 1
sta (253),y
iny
dec 1
lda 53281
inc 1
sta (253),y
iny
lda menuy
sta (253),y
iny
lda menux1
sta (253),y
lda #$77
sta 1
cli
ldy menux1
ldx menuy
clc
jmp plot
screen'restore jsr get'number
sta 252
clc
adc #4
sta 254
lda #0
sta 253
sta 251
lda #home
jsr chrout
jsr old'rom'patch
sei
lda #0
sta 1
ldx #3
ldy #0
- lda (251),y
sta (209),y
lda (253),y
dec 1
sta (243),y
inc 1
iny
bne -
inc 210
inc 252
inc 244
inc 254
dex
bpl -
dec 254
ldy #233
lda (253),y
dec 1
sta 53280
iny
inc 1
lda (253),y
dec 1
sta 53281
inc 1
iny
lda (253),y
sta 214
iny
lda (253),y
sta 211
lda #$77
sta 1
cli
jmp 58732
menu'entry lda #0
sta temp
sta flag
- jsr get'number
ldy temp
sta menuy,y
inc temp
cpy #6
bne -
menu jsr linx
ldx menuy
ldy #0
sty menu'current
clc
jsr plot
jsr old'rom'patch
lda menu'highlight
sta mcolor
jsr paint'line
menu'wait jsr getin
beq menu'wait
ldx menu'current
stx temp
cmp #crsr'down
beq menu'down
cmp #crsr'up
beq menu'up
cmp #13
beq menu'select
cmp exit'key
bne menu'wait'loop
dec flag
bmi menu'select
menu'wait'loop jmp menu'wait
menu'down inc menu'current
lda menu'current
cmp menu'items
bne highlight
lda #0
sta menu'current
jmp highlight
menu'up dec menu'current
lda menu'current
cmp #255
beq +
jmp highlight
+ ldy menu'items
dey
sty menu'current
jmp highlight
menu'select lda menu'current
clc
adc menuy
tax
ldy #0
jsr plot
jsr old'rom'patch
lda menu'text
sta mcolor
jsr paint'line
bit flag
bmi +
lda menu'current
clc
adc #49
sta 631
lda #1
sta 198
+ rts
highlight lda menuy
clc
adc menu'current
tax
ldy #0
clc
jsr plot
jsr old'rom'patch
lda menu'highlight
sta mcolor
jsr paint'line
lda menuy
clc
adc temp
tax
ldy #0
clc
jsr plot
jsr old'rom'patch
lda menu'text
sta mcolor
jsr paint'line
jmp menu'wait
paint'line ldy menux1
- lda mcolor
sta (243),y
bmi +
lda (209),y
eor #128
sta (209),y
+ iny
cpy menux2
beq -
bcc -
rts
;**** get number from BASIC ****
get'number jsr $aefd
jsr $ad8a
jsr $b7f7
lda $14 ; got low byte
rts
;***** get string from BASIC ****
get'string jsr $aefd
jsr $ad9e
jsr $b6a3
ldx $22
ldy $23
rts
print'at jsr linx
jsr get'number
sta 211
jsr get'number
sta 214
jsr 58732
jsr get'string
sta temp
print'string ldy #0
- lda ($22),y
jsr chrout
iny
cpy temp
bne -
rts
ucase jsr get'string
sta temp
ldy #0
- lda ($22),y
cmp #65
bcc +
ora #128
sta ($22),y
+ iny
cpy temp
bne -
rts
lcase jsr get'string
sta temp
ldy #0
- lda ($22),y
and #127
sta ($22),y
iny
cpy temp
bne -
rts
fcase lda #255
sta flag
jsr get'string
sta temp
ldy #0
lda ($22),y
cmp #65
bcc +
ora #128
sta ($22),y
+ iny
lda #0
sta flag
ldy #1
- lda ($22),y
and #127
sta ($22),y
cmp "."
bne +
dec flag
+ cmp "!"
bne +
dec flag
+ cmp "?"
bne +
dec flag
+ bit flag
bmi +
iny
cpy temp
bne -
rts
+ cmp #65
bcc +
ora #128
sta ($22),y
inc flag
+ iny
cpy temp
bne -
rts
center jsr get'number
tax
ldy #0
clc
jsr plot
jsr get'string
sta temp
lsr
sta flag
lda #20
sec
sbc flag
sta 211
jsr 58732
jmp print'string
old'rom'patch lda 210
sec
sbc 648
clc
adc #$d8
sta 244
lda 209
sta 243
rts
menuy .byt 0
menux1 .byt 0
menux2 .byt 0
menu'items .byt 0
menu'text .byt 0
menu'highlight .byt 0
exit'key .byt 0
menu'current .byt 0
mcolor .byt 0